package cn.edu.zafu.bigdata.bd121.studentdb.command.impl;

import cn.edu.zafu.bigdata.bd121.studentdb.command.BaseCommand;
import cn.edu.zafu.bigdata.bd121.studentdb.entity.StudentPO;
import cn.edu.zafu.bigdata.bd121.studentdb.utils.InputUtils;

import java.util.Objects;

/**
 * 查询学生信息命令
 *
 * @author 202211090121
 */
public class SelectStudent extends BaseCommand {

    /**
     * 执行命令
     */
    @Override
    public void execute() {
        handleUserInput();
    }

    /**
     * 处理用户输入
     */
    @Override
    protected void handleUserInput() {
        StudentPO studentPo = InputUtils.getStudentPo();
        if (Objects.isNull(studentPo)) {
            System.out.println("未查询到相关学生信息");
        } else {
            System.out.println("查询到的学生信息如下：");
            System.out.println(studentPo);
        }
    }

}
